package cn.stylefeng.guns.modular.gridsystem.enums;

import cn.stylefeng.guns.core.annotion.ExpEnumType;
import cn.stylefeng.guns.core.exception.enums.abs.AbstractBaseExceptionEnum;
import cn.stylefeng.guns.core.factory.ExpEnumCodeFactory;
import cn.stylefeng.guns.modular.gridsystem.constants.BizExpEnumConstant;

/**
 * 入参错误相关枚举
 *
 * @author 乔黎莱莱
 * @date 2022/10/31 14:34
 */
@ExpEnumType(module = BizExpEnumConstant.GUNS_MAIN_MODULE_EXP_CODE, kind = BizExpEnumConstant.MATERIAL_EXCEPTION_ENUM)
public enum SystemParamExceptionEnum implements AbstractBaseExceptionEnum {

    PARAM_NULL_ERROR(1, "入参为空"),

    OBJECT_NULL_ERROR(2, "查询对象为空");

    private final Integer code;

    private final String message;

    SystemParamExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }


    @Override
    public Integer getCode() {
        return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
    }

    @Override
    public String getMessage() {
        return message;
    }
}
